<?php

class Ga_model extends CI_Model{
    function __construct() {
        parent::__construct();
    }
    private $tbl='Ga';
    function load_all(){
        $DB=$this->load->database('khachhang', TRUE);
        return $DB->get($this->tbl);
    }
    function load_by_id($MSG) {
        $DB=$this->load->database('khachhang', TRUE);
        $result=$DB->get_where($this->tbl,array('MSG'=>$MSG));
        return $result;
    }
    function load_gaden($MSG_Di){
        $DB=$this->load->database('khachhang', TRUE);
        $DB->select($this->tbl.'.MSG, '.$this->tbl.'.TENSB, '.$this->tbl.'.THANHPHO, '.$this->tbl.'.QUOCGIA');
        $DB->from($this->tbl);
        $DB->join('tuyenbay','tuyenbay.MSG_Den='.$this->tbl.'.MSG');
        $DB->where('tuyenbay.MSG_Di',$MSG_Di);
        return $DB->get();
    }
}

